package com.quick.log.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.ArrayList;
import java.util.List;

/**
 * @Author: wangxc
 * @GitHub: https://github.com/vector4wang
 * @CSDN: http://blog.csdn.net/qqhjqs?viewmode=contents
 * @BLOG: http://vector4wang.tk
 * @wxid: BMHJQS
 */
@Component
@Slf4j
public class LoggerService {

    public static final String name = "345";


//    @Value("#{'Hello World'.concat('!')}_#{new String('hello world').toUpperCase()}_#{3 gt 4 ? 1 : 0}")
//    private String test;

//    @Value("#{T(cn.hutool.core.date.DateUtil).format(T(cn.hutool.core.date.DateUtil).date(),T(cn.hutool.core.date.DatePattern).PURE_DATETIME_PATTERN)}")
//    private String test;

//    @Value("#{'Hello World'.concat('!')}_#{new String('hello world').toUpperCase()}_#{3 gt 4 ? 1 : 0}_#{'5.00' matches '^-?\\\\d+(\\\\.\\\\d{2})?$'}")
//    private String test;

//    @Value("#{spelTestService.getVal('spelTestService')}")
//    private String test;

    public static List<String> lists = new ArrayList<String>(){{add("123");add("234");add("345");}};


    @Value("${test}#{'Hello World'.concat('!')}")
    private String test;


    @PostConstruct
    public void showLog() {
        log.info("test: {}", test);
        log.debug("我是DEBUG日志");
        log.info("我是INFO日志");
        log.warn("我是WARN日志");
        log.error("我是ERROR日志");
    }


}
